<!--
 * @Author: your name
 * @Date: 2021-09-06 18:33:07
 * @LastEditTime: 2021-09-07 18:57:23
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ej-webui\src\pages\log.vue
-->
<template>
    <div class="content">
     <!-- 表格 -->
    <el-table :data="resData.list" style="width: 100%" size="small">
      <el-table-column type="index" label="序号"></el-table-column>
      <el-table-column label="访问人真实姓名" prop="realname"></el-table-column>
      <el-table-column label="访问方式" prop="method"></el-table-column>
      <el-table-column label="访问路径" prop="content"></el-table-column>
      <el-table-column label="访问时间" prop="logTime"></el-table-column>
    </el-table>   
    <!-- 分页 -->
    <el-pagination
        background
        layout="prev, pager, next, sizes"
        :total="resData.total"
        :page-size="params.pageSize"
        :current-page="params.page"
        @current-change="pageChangeHandler"
        :page-sizes="[5, 10, 15]"
        @size-change="pageSizeChangeHandler"
        >
    </el-pagination>
    </div>
    
</template>
<script>
import request from '@/utils/request'
export default {
    data(){
        return{
            params:{
                page:1,
                pageSize:10
            },
            resData:{},

        }
    },
    methods:{
        //分页查询产品表格
        async pageQueryLogs(){
            let res = await request.get('/baseLog/pageQuery',{
                params:this.params
            })
            this.resData = res.data;
            this.total = res.data.total;
        },
        //page改变事件
        pageChangeHandler(page){
            this.params.page = page;
            this.pageQueryLogs();
        },
        //pageSize改变事件
        pageSizeChangeHandler(pageSize) {
          this.params.pageSize = pageSize;
          this.pageQueryLogs();
    },
    },
    created(){
        this.pageQueryLogs();
    }
}
</script>
<style lang="less" scoped>
</style>